package com.yiqi.lottery.feature.lottery.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.lottery.entity.bo.HomeBo;
import com.yiqi.lottery.entity.bo.LotteryHistoryBo;
import com.yiqi.lottery.entity.bo.LuckyHistoryBo;
import com.yiqi.lottery.entity.bo.OrderBo;
import com.yiqi.lottery.feature.lottery.contract.HomeContract;
import com.yiqi.lottery.feature.lottery.contract.LottoContract;
import com.yiqi.lottery.feature.lottery.dependencies.home.DaggerHomeModelComponent;
import com.yiqi.lottery.feature.lottery.dependencies.lotto.DaggerLottoModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.LotteryApi;
import io.reactivex.Observable;

import javax.inject.Inject;
import java.util.List;

public class HomeModel implements HomeContract.Model {

    @Inject
    LotteryApi api;

    @Inject
    public HomeModel() {

        DaggerHomeModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }

    @Override
    public Observable<HomeBo> getHomeData() {
        return api.getHomeData().compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
